﻿<UserControl x:Class="Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Views.Controls.Pager"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="30" d:DesignWidth="300">
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
        <Button Margin="2" Command="{Binding GoToFirstPageCommand}">
            <Image>
                <Image.Style>
                    <Style TargetType="Image">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="True">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToFirst.png"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToFirst_Disabled.png"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </Button>
        <Button Margin="2" Command="{Binding GoToPrevPageCommand}">
            <Image>
                <Image.Style>
                    <Style TargetType="Image">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="True">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToPrev.png"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToPrev_Disabled.png"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </Button>
        <TextBlock Margin="2" VerticalAlignment="Center">
                    <TextBlock.Text>
                        <MultiBinding StringFormat="{}{0} / {1}">
                            <Binding Path="CurrentPage"/>
                            <Binding Path="TotalPage"/>
                        </MultiBinding>
                    </TextBlock.Text>
        </TextBlock>
        <Button Margin="2" Command="{Binding GoToNextPageCommand}">
            <Image>
                <Image.Style>
                    <Style TargetType="Image">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="True">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToNext.png"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToNext_Disabled.png"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </Button>
        <Button Margin="2" Command="{Binding GoToLastPageCommand}">
            <Image>
                <Image.Style>
                    <Style TargetType="Image">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="True">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToLast.png"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/GoToLast_Disabled.png"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </Button>
    </StackPanel>
</UserControl>
